Conversation
|
Size Change: +3.83 kB (+0.02%) Total Size: 24.3 MB
ℹ️ View Unchanged
|
Summary of ChangesHello @scidomino, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces robust support for suspending the CLI application using the Ctrl+Z key combination. It addresses previous limitations by implementing a dedicated React hook to manage the intricate terminal state changes required for proper suspension and resumption. The changes ensure a consistent and functional experience across supported platforms, with appropriate warnings for unsupported environments like Windows. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for suspending the CLI process using Ctrl+Z. The implementation introduces a new useSuspend hook to encapsulate the logic for cleaning up and restoring the terminal state, and adds corresponding tests. The documentation and keybinding descriptions are also updated.
My review found one critical issue: the new keybinding for SUSPEND_APP conflicts with the existing REDO command (Ctrl+Shift+Z), which would break the redo functionality. I've provided a detailed comment and suggestion in packages/cli/src/ui/keyMatchers.test.ts to resolve this conflict by making the keybinding more specific and updating the related test case.
The rest of the changes, including the suspend/resume logic and test refactoring, look solid.
| command: Command.SUSPEND_APP, | ||
| positive: [ | ||
| createKey('z', { ctrl: true }), | ||
| createKey('z', { ctrl: true, shift: true }), | ||
| ], | ||
| negative: [ | ||
| createKey('z'), | ||
| createKey('y', { ctrl: true }), | ||
| createKey('z', { alt: true }), | ||
| ], |
There was a problem hiding this comment.
This test case incorrectly asserts that Ctrl+Shift+Z is a valid keybinding for SUSPEND_APP. This introduces a critical bug by creating a keybinding conflict with the REDO command, which is also bound to Ctrl+Shift+Z.
The current binding for SUSPEND_APP in packages/cli/src/config/keyBindings.ts is { key: 'z', ctrl: true }. Since shift is not specified, it matches both Ctrl+Z and Ctrl+Shift+Z. Because the global keypress handler has higher priority, it will intercept Ctrl+Shift+Z and trigger a suspend, breaking the "redo" functionality.
To fix this, two changes are needed:
-
Update the keybinding definition in
packages/cli/src/config/keyBindings.tson line 298 to be more specific:[Command.SUSPEND_APP]: [{ key: 'z', ctrl: true, shift: false }],
(Since this file is not fully in the diff, I'm adding this context here).
-
Update this test case to correctly assert that
Ctrl+Shift+Zis a negative case forSUSPEND_APP.
Here is the suggested change for this test file:
| command: Command.SUSPEND_APP, | |
| positive: [ | |
| createKey('z', { ctrl: true }), | |
| createKey('z', { ctrl: true, shift: true }), | |
| ], | |
| negative: [ | |
| createKey('z'), | |
| createKey('y', { ctrl: true }), | |
| createKey('z', { alt: true }), | |
| ], | |
| command: Command.SUSPEND_APP, | |
| positive: [ | |
| createKey('z', { ctrl: true }), | |
| ], | |
| negative: [ | |
| createKey('z', { ctrl: true, shift: true }), | |
| createKey('z'), | |
| createKey('y', { ctrl: true }), | |
| createKey('z', { alt: true }), | |
| ], |

Summary
Details
This is a local version of #17630 with merge conflicts resolved. I don't have write access to the fork so I have to create another branch to merge these on.
Related Issues
Fixes #5018
How to Validate
Pre-Merge Checklist